<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <include file="Public:jquery" />
        <include file="Public:dialog" />
        <script type="text/javascript" src="http://mat1.gtimg.com/app/vt/public/openjs/latest.js"></script>
        <link href="../Public/style/icons.css" rel="stylesheet" media="screen" type="text/css" />
        <script type="text/javascript">
        	T.init({
        		appkey : "{:C('QQ_APPKEY')}",
        		callbackurl : "{:C('WEB_DOMAIN')}/board.php"
        	});
        
            $(function(){
            	$(".gr_list").SetTableBgColor();
            	$('#send_broken').click(function(){
            		var broken = art.dialog({
            			title : $(this).text(),
            			lock : true,
            			content : '<input type="text" name="broken_content" class="input_text w480" /><p style="padding-top:4px;"><input type="checkbox" id="post_QQ" /> 同步到腾讯微博</p>',
            			ok : function(){
            				var content = $('input[name="broken_content"]').val();
            				
            				if (content == ''){
            					art.dialog({
            						content : '碎语内容不能为空！',
            						lock : true
            					});
            					return false;
            				}
            				
            				if ($('#post_QQ').attr("checked")){
            					if (T.loginStatus()){
            						
	            					T.api("/t/add",{content:content},"json","POST").success(function(back){
		            					if (back.msg == "ok"){
		            						art.dialog({
		            							title : '成功同步到腾讯微博',
	            								content : content + ' --- 成功同步到腾讯微博',
	            								lock : true
	            							});
		            					}
		            				});
            					}else{
            						T.login();
            						return false;
            					}
            				}
            				
            				$.post(
            					"{:U('broken/insert')}",
            					{ content : content, status : 'submit' },
            					function (eback){
            						if (eback.status == 1){
            							art.dialog({
            								content : content + '发布成功',
            								lock : true
            							});
            						}else{
            							
            						}
            					},
            					"json"
            				);
            			},
            			okVal : '发布碎语',
            			cancel : function(){
            				// --- 
            			}
            		});
            	});
            	
            	/*
            	$('#clear_cache').click(function(){
            		var clear_cache = art.dialog({
            			title : '清除缓存',
            			lock : true
            		});
            		$.ajax({
            			url : '{:U("cache/clearcache")}',
            			success : function(e){
            				clear_cache.content(e);
            				submitstyle();
            				$('form[name="clear_cache"]').submit(function(){
            					if ($('#is_boards').is(':checked') != true && $('#is_applications').is(':checked') != true){
            						art.dialog({
            							content : '请先选择要清除的项目',
            							lock : true
            						});
            						return false;
            					}
            				});
            			},
            			cache : false
            		});
            	});*/
            });
        </script>
        <style type="text/css">
        	.icons_action a				{ color : #913f3f; }
        	.icons_action ul li:hover a	{ color : black; }
        </style>
    </head>
    <body>
        <include file="Public:header" />
        
        <div class="layout">
            
            <include file="Public:position" />
            
            <table class="warp" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <h2 id="welcome_title">Hi, {$_SESSION['loginUserID']}({$_SESSION['loginUserName']}).  Welcome to {:C('ADMIN_TITLE')}</h2>
                        
                        <div class="icons_action">
                        	<div id="dashboard-buttons" style="margin : 10px 10px 0px 10px;">
	                            <ul>
	                                <li><a href="javascript:void(0);" class="Clipboard_3 tooltip" id="send_broken" title="发布碎语">发布碎语</a></li>
	                                
	                                <li>
	                                    <a href="#" class="Star tooltip" title="Star">
	                                        Star
	                                    </a>
	                                    <div class="clear"></div>
	                                </li>
	                            </ul>
	                            <div class="clear"></div>
	                        </div>
                        </div>
                        
                        <div class="a_table" style="margin:10px;">
                        <table cellspacing="1" class="gr_list" width="100%">
                            <tr>
                                <th colspan="2" align="left" class="title">系统信息</th>
                            </tr>
                            <tr>
                                <td width="12%" align="right" class="left_text">程序版本</td>
                                <td align="left"></td>
                            </tr>
                            <foreach name="info" item="v" mod="2">
                            <tr>
                                <td width="12%" align="right" class="left_text">{$key}</td>
                                <td align="left">{$v}</td>
                            </tr>
                            </foreach>
                        </table>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        
        <include file="Public:footer" />
    </body>
</html>